package com.tao.clients;

import com.tao.param.ProductSearchParam;
import com.tao.pojo.Product;
import com.tao.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 86130
 * 搜索服务调用客户端
 */
@FeignClient("search-service")
public interface SearchClient {

    /**
     *搜索服务
     * @param productSearchParam
     * @return
     */
    @PostMapping("/search/product")
    R search(@RequestBody ProductSearchParam productSearchParam);

    /**
     *数据同步
     * @param product
     * @return
     */
    @PostMapping("/search/save")
    R saveOrUpdate(@RequestBody Product product);

    /**
     *es库数据删除
     * @param productId
     * @return
     */
    @PostMapping("/search/remove")
    R remove(@RequestBody Integer productId);
}
